"""
ASGI config for Django_Langchain_RAG project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
"""

import os
import django
from django.core.asgi import get_asgi_application



os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Django_Langchain_RAG.settings")
django.setup()

from channels.routing import ProtocolTypeRouter,URLRouter
from file import routing
from whitenoise import WhiteNoise

# application = get_asgi_application()

application = ProtocolTypeRouter({
    "http": get_asgi_application(),
    "websocket": URLRouter(
        routing.websocket_urlpatterns  # 确保使用正确的变量名
    ),
})
